#pragma warning disable 108
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Cephei;
using Cephei.Core;
using Cephei.Core.Generic;
using Microsoft.FSharp.Core;
using Cephei.QL.Termstructures;
namespace Cephei.QL.Termstructures.Inflation
{
    /// <summary> 
	/// ! Stationary multiplicative seasonality in CPI/RPI/HICP (i.e. in price) implies that zero inflation swap rates are affected, but that year-on-year inflation swap rates show no effect.  Of course, if the seasonality in CPI/RPI/HICP is non-stationary then both swap rates will be affected.  Factors must be in multiples of the minimum required for one year, e.g. 12 for monthly, and these factors are reused for as long as is required, i.e. they wrap around.  So, for example, if 24 factors are given this repeats every two years.  True stationary seasonality can be obtained by giving the same number of factors as the frequency dictates e.g. 12 for monthly seasonality.  \warning Multi-year seasonality (i.e. non-stationary) is fragile: the user <b>must</b> ensure that corrections at whole years before and after the inflation term structure base date are the same.  Otherwise there can be an inconsistency with quoted rates.  This is enforced if the frequency is lower than daily.  This is not enforced for daily seasonality because this will always be inconsistent due to weekends, holidays, leap years, etc.  If you use multi-year daily seasonality it is up to you to check.  \note Factors are normalized relative to their appropriate reference dates.  For zero inflation this is the inflation curve true base date: since you have a fixing for that date the seasonality factor must be one.  For YoY inflation the reference is always one year earlier.  Seasonality is treated as piecewise constant, hence it works correctly with uninterpolated indices if the seasonality correction factor frequency is the same as the index frequency (or less).
	/// </summary>
    [Guid ("2C89267A-BDBA-4ad6-B886-5488F3BDD77B"),ComVisible(true)]
	public interface IMultiplicativePriceSeasonality : Cephei.QL.Termstructures.Inflation.ISeasonality
	{
		///////////////////////////////////////////////////////////////
        // Methods
        //
        /// <summary> 
		/// 
		/// </summary>
		 QL.Times.FrequencyEnum Frequency {get;}
        /// <summary> 
		/// 
		/// </summary>
		 DateTime SeasonalityBaseDate {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double SeasonalityFactor(DateTime d);
        /// <summary> 
		/// 
		/// </summary>
		 Double CorrectYoYRate(DateTime d, Double r, Cephei.QL.Termstructures.IInflationTermStructure iTS);
        /// <summary> 
		/// 
		/// </summary>
		 Double CorrectZeroRate(DateTime d, Double r, Cephei.QL.Termstructures.IInflationTermStructure iTS);
        /// <summary> 
		/// 
		/// </summary>
		 Boolean IsConsistent(Cephei.QL.Termstructures.IInflationTermStructure iTS);
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.Core.IVector<Double> SeasonalityFactors {get;}
        /// <summary> 
		/// 
		/// </summary>
		 IMultiplicativePriceSeasonality Set(DateTime seasonalityBaseDate, QL.Times.FrequencyEnum frequency, Cephei.Core.IVector<Double> seasonalityFactors);
    }   

    /// <summary> 
	/// ! Stationary multiplicative seasonality in CPI/RPI/HICP (i.e. in price) implies that zero inflation swap rates are affected, but that year-on-year inflation swap rates show no effect.  Of course, if the seasonality in CPI/RPI/HICP is non-stationary then both swap rates will be affected.  Factors must be in multiples of the minimum required for one year, e.g. 12 for monthly, and these factors are reused for as long as is required, i.e. they wrap around.  So, for example, if 24 factors are given this repeats every two years.  True stationary seasonality can be obtained by giving the same number of factors as the frequency dictates e.g. 12 for monthly seasonality.  \warning Multi-year seasonality (i.e. non-stationary) is fragile: the user <b>must</b> ensure that corrections at whole years before and after the inflation term structure base date are the same.  Otherwise there can be an inconsistency with quoted rates.  This is enforced if the frequency is lower than daily.  This is not enforced for daily seasonality because this will always be inconsistent due to weekends, holidays, leap years, etc.  If you use multi-year daily seasonality it is up to you to check.  \note Factors are normalized relative to their appropriate reference dates.  For zero inflation this is the inflation curve true base date: since you have a fixing for that date the seasonality factor must be one.  For YoY inflation the reference is always one year earlier.  Seasonality is treated as piecewise constant, hence it works correctly with uninterpolated indices if the seasonality correction factor frequency is the same as the index frequency (or less). Factory
	/// </summary>
   	[ComVisible(true)]
    public interface IMultiplicativePriceSeasonality_Factory 
    {
        ///////////////////////////////////////////////////////////////
        // Factory methods
        //
        /// <summary> 
		/// 
		/// </summary>
	    IMultiplicativePriceSeasonality Create (DateTime seasonalityBaseDate, QL.Times.FrequencyEnum frequency, Cephei.Core.IVector<Double> seasonalityFactors);
        /// <summary> 
		/// Multiplicative Seasonality on price = on CPI/RPI/HICP/etc
		/// </summary>
	    IMultiplicativePriceSeasonality Create ();
    }
}

